package com.yjt.fresh.adpater;

import android.app.Activity;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.yjt.fresh.base.BaseSimpleFragment;
import com.yjt.fresh.fragment.order.FrgOrderBase;

import java.util.ArrayList;

/**
 * description:
 * Created by mcc on 2018/1/17.
 */

public class AdpVpFrg extends FragmentStatePagerAdapter {

    private ArrayList<BaseSimpleFragment> mFrgs;

    public AdpVpFrg(FragmentManager fm, ArrayList<BaseSimpleFragment> frgOrderBases) {
        super(fm);
        mFrgs = frgOrderBases;
    }

    @Override
    public Fragment getItem(int position) {
        if (mFrgs != null && mFrgs.size() > 0)
            return mFrgs.get(position);
        return null;
    }

    @Override
    public int getCount() {
        if (mFrgs != null && mFrgs.size() > 0)
            return mFrgs.size();
        return 0;
    }
}
